package ch.nostromo.tiffanys.engines;

import ch.nostromo.tiffanys.game.move.MoveInput;

public class EngineResult {
  private MoveInput selectedMove;
  private MoveInput[] calculatedMoves;
  private String engineInfo;
  private int nodes;
  private int abCutOffs;
  private int positionsEvaluated;
  private int depth;
  private boolean isOpeningMove;
  private String openingLine = "";

  private double time;
  

  public EngineResult(MoveInput selectedMove, MoveInput[] calculatedMoves, double time, String engineInfo, int nodes, int abCutOffs, int positionsEvaluated, int depth) {
    this.selectedMove = selectedMove;
    this.calculatedMoves = calculatedMoves;
    this.engineInfo = engineInfo;
    this.nodes = nodes;
    this.abCutOffs = abCutOffs;
    this.positionsEvaluated = positionsEvaluated;
    this.depth = depth;
    this.time = time;
    this.isOpeningMove = false;
  }

  public EngineResult(MoveInput selectedMove, MoveInput[] calculatedMoves, double time, String engineInfo, String openingLine) {
    this.selectedMove = selectedMove;
    this.calculatedMoves = calculatedMoves;
    this.engineInfo = engineInfo;
    this.time = time;
    this.openingLine = openingLine;
    this.isOpeningMove = true;
  }
  
  public MoveInput[] getCalculatedMoves() {
    return calculatedMoves;
  }

  public MoveInput getSelectedMove() {
    return selectedMove;
  }

  public String getEngineInfo() {
    return engineInfo;
  }

  public void setEngineInfo(String engineInfo) {
    this.engineInfo = engineInfo;
  }

  public int getNodes() {
    return nodes;
  }

  public void setNodes(int nodes) {
    this.nodes = nodes;
  }

  public int getAbCutOffs() {
    return abCutOffs;
  }

  public void setAbCutOffs(int abCutOffs) {
    this.abCutOffs = abCutOffs;
  }

  public int getPositionsEvaluated() {
    return positionsEvaluated;
  }

  public void setPositionsEvaluated(int positionsEvaluated) {
    this.positionsEvaluated = positionsEvaluated;
  }

  public int getDepth() {
    return depth;
  }

  public void setDepth(int depth) {
    this.depth = depth;
  }

  public boolean isOpeningMove() {
    return isOpeningMove;
  }

  public void setOpeningMove(boolean isOpeningMove) {
    this.isOpeningMove = isOpeningMove;
  }

  public double getTime() {
    if (time == 0) {
      return 1;
    } else {
      return time;
    }
  }

  public void setTime(double time) {
    this.time = time;
  }

  public void setSelectedMove(MoveInput selectedMove) {
    this.selectedMove = selectedMove;
  }

  public void setCalculatedMoves(MoveInput[] calculatedMoves) {
    this.calculatedMoves = calculatedMoves;
  }

  public String getOpeningLine() {
    return openingLine;
  }

  public void setOpeningLine(String openingLine) {
    this.openingLine = openingLine;
  }

  
}
